from rest_framework.serializers import ModelSerializer
from .models import *
from rest_framework import serializers

class Newsser(ModelSerializer):
    class Meta:
        model = News
        fields = "__all__"

class Adser(ModelSerializer):
    class Meta:
        model = Ad
        fields = "__all__"

class Userser(ModelSerializer):
    class Meta:
        model = User
        fields = "__all__"

class Addressser(ModelSerializer):
    class Meta:
        model = Address
        fields = "__all__"

class AreaSer(ModelSerializer):
    class Meta:
        model = Area
        fields = "__all__"

class ShowAddressser(ModelSerializer):
    province = serializers.StringRelatedField()
    city = serializers.StringRelatedField()
    area = serializers.StringRelatedField()
    class Meta:
        model = Address
        fields = "__all__"